const path =  require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");


module.exports  = {
    mode:"production",
    entry:path.resolve("index.js"),
    output:{
        path:path.resolve("dist"),
        filename:"boundle.js"
    },
    plugins:[
        new HtmlWebpackPlugin({
            template:path.resolve("index.html"),
            filename: "index.html",//打包完之后生成的html文件名称！
        })
    ],
    module:{
        rules:[
            {
                test: /\.js$/,
                use: {
                  loader: "babel-loader",
                  options: {
                  presets: ["@babel/preset-env"],
                  },
                },
             },
        ]
    }
}